package PL.practica10;

import org.antlr.runtime.Token;
import org.antlr.runtime.tree.CommonTree;

public class MiArbol extends CommonTree {

	private boolean valid = false;

	private int columna;
	private int linea;

	public MiArbol() {

	}
	public MiArbol(Token t) {
		super(t);

		if (t != null) {
			columna = t.getCharPositionInLine();
			linea = t.getLine();
			valid = true;
		}     
	}

	public MiArbol (Token t, String file){
		super(t);

		if (t != null) {
			columna = t.getCharPositionInLine();
			linea = t.getLine();
			valid = true;
		}     
	}


	public String toString() {

		StringBuffer sb = new StringBuffer("");

		sb.append(super.toString());

		if (valid) {
			sb.append(" (linea: ");
			sb.append(linea);
			sb.append(", columna: ");
			sb.append(columna);
			sb.append(")");
		}

		return sb.toString();
	}
}